package com.eastfair.venueservice.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.venueservice.dto.EvaluateComplaintDTO;
import com.eastfair.venueservice.dto.EvaluateComplaintPageQuery;
import com.eastfair.venueservice.entity.EvaluateComplaint;
import com.eastfair.venueservice.vo.EvaluateComplaintVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 业务接口
 * 评价投诉记录
 * </p>
 *
 * @author lyw
 * @date 2023-02-03
 */
public interface EvaluateComplaintService extends SuperService<EvaluateComplaint> {

    /**
     * 分页查询评价投诉列表
     * @param pageParams
     * @return
     */
    IPage<EvaluateComplaintVO> queryEvaluateComplaintList(PageParams<EvaluateComplaintDTO> pageParams);

    /**
     * 场馆综合展会详情查询评价投诉列表.
     *
     * @param pageParams the page params
     * @return the page
     */
    IPage<EvaluateComplaintVO> queryForVenueExhibition(PageParams<EvaluateComplaintDTO> pageParams);

    /**
     * 保存评价投诉
     *
     * @param evaluateComplaintDTO
     * @return
     */
    Boolean saveEvaluateComplaintInfo(EvaluateComplaintDTO evaluateComplaintDTO);

    /**
     * 修改评价投诉
     * @return
     */
    Boolean updateEvaluateComplaintById(EvaluateComplaintDTO evaluateComplaintDTO);

    /**
     * 更新评价回复.
     *
     * @param evaluateComplaintDTO the evaluate complaint dto
     * @return the boolean
     */
    boolean updateEvaluateComplaintReply(EvaluateComplaintDTO evaluateComplaintDTO);

    /**
     * 删除评价投诉
     * @param evaluateComplaintDTO
     * @return
     */
    Boolean delEvaluateComplaintById(EvaluateComplaintDTO evaluateComplaintDTO);

    /**
     * id查询评价投诉详情
     * @param id
     * @return
     */
    EvaluateComplaintVO  getEvaluateComplaintInfoById(Long id);

    /**
     * 通过服务商id查询投诉评价数量
     * @param evaluateServiceProviderId
     * @return
     */
    int getCountByServiceProviderId(Long evaluateServiceProviderId);

    /**
     * id查询服务商信誉等级
     * @param id
     * @return
     */
    Map<String,List<String>> getReputationLevelById(Long id);

    /**
     * 展会id的统计评价数量和未评价数量.
     *
     * @param exhibitionManageId the exhibition manage id
     * @return the list
     */
    List<Map<String, Object>> countEvaluateServiceByExhibitionId(Long exhibitionManageId);

    /**
     * 展会id的统计已评价服务数量.
     *
     * @param exhibitionManageId the exhibition manage id
     * @return the list
     */
    Long countHasEvaluateServiceByExhibitionId(Long exhibitionManageId);

    /**
     * 展会id的统计已评价服务数量.
     *
     * @param exhibitionManageId the exhibition manage id
     * @return the list
     */
    Long countNotEvaluateServiceByExhibitionId(Long exhibitionManageId);


    /**
     * 展会id的统计评星数量.
     *
     * @param exhibitionManageId the exhibition manage id
     * @return the list
     */
    List<Map<String, Object>> countScoreByExhibitionId(Long exhibitionManageId);

    /**
     * 展会ID统计各个服务的星级.
     *
     * @param exhibitionManageId the exhibition manage id
     * @param topN               the top n
     * @return the map
     */
    Map<String, Object> countServiceScoreByExhibitionId(Long exhibitionManageId, Integer topN);

    /**
     * 展会ID查询评价数量前N的服务.
     *
     * @param exhibitionManageId the exhibition manage id
     * @param topN               the top n
     * @return the list
     */
    List<EvaluateComplaintVO> listEvaluateServiceByExhibitionId(Long exhibitionManageId, Integer topN);

    /**
     * 展会ID统计各个服务的星级.
     *
     * @param exhibitionManageId the exhibition manage id
     * @return the list
     */
    List<EvaluateComplaintVO> countServiceScoreByExhibitionId(Long exhibitionManageId);

    /**
     * 查询主场服务评价数量.
     *
     * @param exhibitionManageId the exhibition manage id
     * @param homeId             the home id
     * @return the list
     */
    Map<String, Object> countHomeServiceEvaluate(Long exhibitionManageId, Long homeId);
}
